#ifndef DependencyEncoder3OGSibling_H
#define DependencyEncoder3OGSibling_H
#include "DependencyEncoder2O.h"
#include "DependencyPipe3OGSibling.h"
#include "DependencyInstance.h"

class DependencyEncoder3OGSibling : public DependencyEncoder2O{
public:
	DependencyEncoder3OGSibling(int maxLength, DependencyPipe *pipe, char *trainforest, Parameters *param);
	virtual ~DependencyEncoder3OGSibling();
	virtual double gradient(long double *expected, int length);

protected:
	vector<vector<vector<vector<double> > > > probs_gtrips;
	vector<vector<vector<vector<double> > > > probs_gsibs;
	vector<vector<vector<double> > > probs_coords;

	virtual int getKey(int g, int s, int t, int dir, int comp, int length);
	virtual double getZ(int length, double *beta, DependencyInstance *instance);
	virtual void inside_outside(int length, double *beta, double *alpha, DependencyInstance *instance);
	virtual void getExpected(long double *expected, double *beta, double *alpha, double z, int length, DependencyInstance *instance);
	double getGrandTripProb(int gpar, int par, int ch1, int ch2, vector<vector<vector<vector<double> > > > &probs_gtrips);
};
#endif
